<template>
    <div>
<van-nav-bar
  title="标题"
  left-text="返回"
  left-arrow
  @click-left="onClickLeft"
/>
<div v-for="item in searchApiData">
    <van-card
  :price="item.goods_price"
  :title="item.goods_name"
  :thumb="item.goods_small_logo?item.goods_small_logo:'https://fastly.jsdelivr.net/npm/@vant/assets/ipad.jpeg'"
/>
</div>
    </div>
</template>

<script setup>
const onClickLeft = () => history.back();
import { ref } from 'vue';
import { useRoute } from 'vue-router';
let route=useRoute()
console.log(route.params.query);
import { searchApi } from '@/api/api';
let searchApiData=ref([])
searchApi(route.params.query).then(res=>{
    searchApiData.value=res.data.message.goods
    console.log(res);
    
})
</script>

<style lang="scss" scoped>

</style>